package com.danci.controller;


import com.danci.common.Result;
import com.danci.dto.UserRequest;
import com.danci.entity.Lexicon;
import com.danci.service.ILexiconService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 词库主表 前端控制器
 * </p>
 *
 * @author xxx
 * @since 2024-05-13
 */
@RestController
@RequestMapping("/lexicon")
@Api("词库表")
@AllArgsConstructor
public class LexiconController {

    private final ILexiconService lexiconService;

    @ApiOperation("获取词库信息")
    @PostMapping("/getLexiconList")
    public Result getLexiconList(@RequestBody UserRequest userRequest) {
        return lexiconService.getLexiconList(userRequest);
    }

    @ApiOperation("新增词库信息")
    @PostMapping("/add")
    public Result getLexiconList(@RequestBody Lexicon lexicon) {
        return lexiconService.insertLexicon(lexicon);
    }

}
